import request from '@/utils/request'
const moduleApi = '/operation/marActivity'
const moduleApi2 = '/operation'

// 新增邀请有礼活动
export function addIntivationApi(data) {
  return request({
    url: moduleApi + `/add`,
    method: 'post',
    data
  })
}
/**编辑邀请有礼活动 */
export function editIntivationApi(data) {
  return request({
    url: moduleApi + `/updateActivity`,
    method: 'put',
    data
  })
}

// 获取进行中优惠券列表
export function getStartCouponApi(params) {
  return request({
    url: moduleApi2 + `/marCoupon/list`,
    method: 'get',
    params
  })
}
// 获取全部优惠券
export function getAllCouponListApi(data) {
  return request({
    url: moduleApi2 + `/marCoupon/groupList`,
    method: 'post',
    data
  })
}
// 获取邀请有礼活动列表
export function getInvitationListApi(params) {
  return request({
    url: moduleApi + `/list`,
    method: 'get',
    params
  })
}
// 获取邀请纪录列表
export function getRecordsApi(params) {
  return request({
    url: moduleApi + `/invite`,
    method: 'get',
    params
  })
}
// 获取参与详情
export function getJoinListApi(params) {
  return request({
    url: moduleApi + `/participation`,
    method: 'get',
    params
  })
}
// 查看奖励
export function getRewardApi(params) {
  return request({
    url: moduleApi + `/findActivityAward`,
    method: 'get',
    params
  })
}
// 获取=活动详情
export function getInvitationDetailApi(params) {
  return request({
    url: moduleApi + `/id`,
    method: 'get',
    params
  })
}
// 修改活动状态
export function updateInvitationApi(params) {
  return request({
    url: moduleApi + `/efficacy`,
    method: 'put',
    params
  })
}
